package com.token;

import org.apache.shiro.authz.Permission;
import org.apache.shiro.authz.permission.PermissionResolver;
import org.apache.shiro.authz.permission.WildcardPermission;
import org.springframework.stereotype.Component;

@Component
public class ShiroPermissionResolver implements PermissionResolver {
    @Override
    public Permission resolvePermission(String s) {
        if(s.startsWith("$")){
            return new MyPermission(s);
        }
        return new WildcardPermission(s);
    }
}
